<?php
namespace Admin\Model;
use Think\Model;

class EventModel extends Model {

    protected $_validate = array (
		array('title','require','Title cannot be empty', 1),
		array('date','require','Date cannot be empty', 1),
		array('time','require','Time cannot be empty', 1),
		array('address','require','Address cannot be empty', 1),
		array('content','require','Panelist cannot be empty', 1),
		array('speaker','require','Speaker Bio cannot be empty', 1),
    );	

    protected $_auto = array (
		array('createTime','time',Model::MODEL_INSERT,'function'),
		array('updateTime','time',Model::MODEL_BOTH,'function'),	
		array('date','_date',Model::MODEL_BOTH,'callback'),
	);

	protected function _date(){
		return strtotime(I('post.date'));
	}

}
?>